package com.amyi.usercenter.service;

import com.amyi.usercenter.domain.User;
import com.baomidou.mybatisplus.extension.service.IService;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * 用户服务
* @author 张莹莹
* @description 针对表【user(用户表)】的数据库操作Service
* @createDate 2023-10-09 15:38:09
*/
public interface UserService extends IService<User> {
    /**
     * 用户注册
     * @param userAccount 用户账户
     * @param userPassword 用户密码
     * @param checkPassword 校验密码
     * @param planetCode 星球编号
     * @return 新用户id
     */
     long userRegister(String userAccount,String userPassword,String checkPassword,String planetCode);

    /**
     * 用户登录
     * @param userAccount 用户账户
     * @param userPassword 用户密码
     * @param request
     */
     User login(String userAccount, String userPassword, HttpServletRequest request);


    /**
     *  用户注销
     * @param request
     * @return
     */
    int userLogout(HttpServletRequest request);

    /**
     * 获取当前用户
     * @param request
     * @return
     */
    User getCurrentUser(HttpServletRequest request);

    /**
     * 查找用户
     * @param username
     * @param request
     * @return
     */
    List<User> searchUsers(String username, HttpServletRequest request);

    /**
     * 删除用户
     * @param id
     * @param request
     * @return
     */
    boolean deleteUser(long id, HttpServletRequest request);
}
